package com.execdemo.demoeventservice.service;


import com.alibaba.fastjson.JSON;
import com.execdemo.demoeventservice.enumerate.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class MqBackMessage {

    @RabbitListener(queues = "mqback")
    @Async
    public void backMessage(String message) {

        Result result = JSON.parseObject(message, Result.class);
        System.out.println("返回提示信息 : " + result);
    }
}
